<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <script src="https://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
    <link href="https://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="https://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script src="https://how2j.cn/study/vue.min.js"></script>
    <script src="https://how2j.cn/study/axios.min.js"></script>
</head>
<body>
<form action="/company/recruitAdd" method="get" id="div1">
    <div style="width: 500px">
        <input name="id" hidden :value="data.id">
        <div class="input-group">
            <span class="input-group-addon" >名称</span>
            <input type="text" class="form-control" name="name" :value="data.name">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >公司名称</span>
            <input type="text" class="form-control" name="companyName" :value="data.companyName">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >行业</span>
            <input type="text" class="form-control" name="industry" :value="data.industry">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >工作名称</span>
            <input type="text" class="form-control" name="jobName" :value="data.jobName">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >学历</span>
            <input type="text" class="form-control" name="education" :value="data.education">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >工资</span>
            <input type="text" class="form-control" name="salary" :value="data.salary">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >有效时间</span>
            <input type="text" class="form-control" name="effectiveTimeStr" :value="data.effectiveTime">
        </div>
        <div class="input-group">
            <span class="input-group-addon" >工作详情</span>
            <input type="text" class="form-control" name="jobDetails" :value="data.jobDetails">
        </div>

        <button type="submit" class="btn btn-success">提交</button>
    </div>
</form>
</body>


<script>
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
    new Vue({
        el:'#div1',
        data:{
            data:{}
        },
        mounted:function(){ //mounted　表示这个 Vue 对象加载成功了
            var self = this
            var id=GetQueryString("id");
            axios.get("/company/findRecruitById?id="+id).then(function(response) {
                self.data= response.data; //此时还是字符串
            })
        },
        methods:{

        }
    })

</script>
</html>
